package top.timous.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.timous.mapper.teacher.TeacherMapper;
import top.timous.pojo.ScoreEntity;
import top.timous.pojo.StudentEntity;
import top.timous.pojo.TeacherEntity;
import top.timous.service.TeacherService;
import top.timous.vo.*;

import java.util.List;

/**
 * @Author luming
 * @Date 2020/12/4 11:37
 */
@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;
    //登录
    @Override
    public TeacherEntity teacherLogin(TeacherEntity teacherEntity) {
        return teacherMapper.queryTeacherIdAndPwd(teacherEntity);
    }

    @Override
    public List<StudentEntity> queryAllStudentInfo(StudentInfos studentInfos) {

        return teacherMapper.queryAllStudentInfo(studentInfos);
    }

    @Override
    public int queryAllStudentInfoCount(StudentInfos studentInfos) {
        return teacherMapper.queryAllStudentInfoCount(studentInfos);
    }

    @Override
    public int addStudentInfo(StudentEntity studentEntity) {
        return teacherMapper.addStudentInfo(studentEntity);
    }

    @Override
    public void updateStudentInfoById(StudentEntity studentEntity) {
        teacherMapper.updateStudentInfo(studentEntity);
    }





    @Override
    public void deleteStudentInfo(String id) {
        teacherMapper.deleteStudentInfo(id);
    }




    @Override
    public int updatePassword(TeacherEntity teacherEntity) {
        return teacherMapper.updatePassword(teacherEntity);
    }

    @Override
    public TeacherEntity queryOwnInfo(TeacherEntity teacherEntity) {
        return teacherMapper.queryOwnInfo(teacherEntity);
    }

    @Override
    public List<StudentbyPassword> queryStuScoreByStuId(StudentbyPassword studentbyPassword) {
        return teacherMapper.queryStuScoreByStuId(studentbyPassword);
    }

    @Override
    public String queryClassNameById(Integer classId) {
        return teacherMapper.queryClassNameById(classId);
    }

    @Override
    public String queryHomeNameById(Integer homeId) {
        return teacherMapper.queryHomeNameById(homeId);
    }

    @Override
    public Integer queryclassIdByclassName(String className) {
        return teacherMapper.queryclassIdByclassName(className);
    }

    @Override
    public Integer queryhomeIdByhomeName(String homeName) {
        return teacherMapper.queryhomeIdByhomeName(homeName);
    }

    @Override
    public List<TeacherCourse> queryclassInfo(String teaId) {
        return teacherMapper.queryclassInfo(teaId);
    }

    //批量删除学生信息
    @Override
    public void deleteStudentInfos(String[] ids) {
        teacherMapper.deleteStudentInfos(ids);
    }


    @Override
    public List<StudentScore> queryStudentScore(StudentScore studentScore) {
        return teacherMapper.queryStudentScore(studentScore);
    }



    @Override
    public StudentEntity queryStuInfoByStuId(String stuId) {
        return teacherMapper.queryStuInfoByStuId(stuId);
    }

    @Override
    public void updateScore(StudentScore student) {
        teacherMapper.updateScore(student);
    }

    @Override
    public Integer queryCouIdByCouName(String couName) {
        return teacherMapper.queryCouIdByCouName(couName);
    }

    @Override
    public void addScore(ScoreEntity scoreEntity) {
        teacherMapper.addScore(scoreEntity);
    }

    @Override
    public String queryStuNameByStuId(String stuId) {
        return teacherMapper.queryStuNameByStuId(stuId);
    }

    @Override
    public Integer queryCreditByCouName(String couName) {
        return teacherMapper.queryCreditByCouName(couName);
    }

    @Override
    public int queryStudentScoreCount(StudentScore score) {
        return teacherMapper.queryStudentScoreCount(score);
    }

    @Override
    public int queryAmount(Amount amount) {
        return teacherMapper.queryAmount(amount);
    }


//    @Override
//    public StudentEntity queryStuscoreByStuId(String stuId) {
//        return null;
//    }


}
